]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
search: Be a bit more careful in _doSearch about timeouts
authorJasper St. Pierre <jstpierre@mecheye.net>
Thu, 11 Sep 2014 23:51:12 +0000 (17:51 -0600)
committerJasper St. Pierre <jstpierre@mecheye.net>
Thu, 11 Sep 2014 23:51:12 +0000 (17:51 -0600)
js/ui/search.js

index 5798a4e91f991dd94fbded56bdfcd766dbaae454..f4898df3be317b6d70b4c57a6e6932bcc8042d8d 100644 (file)
@@ -470,7 +470,15 @@ const SearchResults = new Lang.Class({
 
         this._updateSearchProgress();
 
+        if (this._searchTimeoutId > 0) {
+            GLib.source_remove(this._searchTimeoutId);
+            this._searchTimeoutId = 0;
+        }
+    },
+
+    _onSearchTimeout: function() {
         this._searchTimeoutId = 0;
+        this._doSearch();
         return GLib.SOURCE_REMOVE;
     },
 
@@ -502,7 +510,7 @@ const SearchResults = new Lang.Class({
         this._updateSearchProgress();
 
         if (this._searchTimeoutId == 0)
-            this._searchTimeoutId = GLib.timeout_add(GLib.PRIORITY_DEFAULT, 150, Lang.bind(this, this._doSearch));
+            this._searchTimeoutId = GLib.timeout_add(GLib.PRIORITY_DEFAULT, 150, Lang.bind(this, this._onSearchTimeout));
     },
 
     _onPan: function(action) {